import {
    ACCOMMODATION_INIT,
    ACCOMMODATION_CHANGE
    } from '../actions';
import { updateState } from '../utils';

const INITIAL_STATE = {
    accommodation: '',
    state:[],
    data: {

    }
};
    
export default function (state = INITIAL_STATE, action = {}) {
    switch (action.type) {
    case ACCOMMODATION_INIT:
        {
        return {  ...state, ...INITIAL_STATE }
        }
    case ACCOMMODATION_CHANGE:
        {
        return updateState(state, action.data);
        }
    default:
        return state;
    }
}